package com.perceptivesoftware.licensing.domain.generated;

import java.util.List;
import java.util.ArrayList;
import javax.persistence.GenerationType;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TwRoleval entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TW_ROLEVAL")
public class TwRoleval implements java.io.Serializable
{

	// Fields    

	private String rolevalRoleCode;

	private TwUserval twUservalByRolevalCreatedBy;

	private TwUserval twUservalByRolevalModifiedBy;

	private String rolevalRoleName;

	private String rolevalRoleDesc;

	private String rolevalDeleted;

	private Timestamp rolevalDateCreated;

	private Timestamp rolevalDateModified;

	private Set<TwRolepriv> twRoleprivs = new HashSet<TwRolepriv>(0);

	private Set<TwUserval> twUservals = new HashSet<TwUserval>(0);

	// Constructors

	/** default constructor */
	public TwRoleval()
	{
		// empty constructor required for Spring
	}

	// Property accessors

	@Id
	@Column(name = "ROLEVAL_ROLE_CODE", unique = true, nullable = false, length = 38)
	public String getRolevalRoleCode()
	{
		return this.rolevalRoleCode;
	}

	public void setRolevalRoleCode(String rolevalRoleCode)
	{
		this.rolevalRoleCode = rolevalRoleCode;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ROLEVAL_CREATED_BY", nullable = false)
	public TwUserval getTwUservalByRolevalCreatedBy()
	{
		return this.twUservalByRolevalCreatedBy;
	}

	public void setTwUservalByRolevalCreatedBy(TwUserval twUservalByRolevalCreatedBy)
	{
		this.twUservalByRolevalCreatedBy = twUservalByRolevalCreatedBy;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ROLEVAL_MODIFIED_BY")
	public TwUserval getTwUservalByRolevalModifiedBy()
	{
		return this.twUservalByRolevalModifiedBy;
	}

	public void setTwUservalByRolevalModifiedBy(TwUserval twUservalByRolevalModifiedBy)
	{
		this.twUservalByRolevalModifiedBy = twUservalByRolevalModifiedBy;
	}

	@Column(name = "ROLEVAL_ROLE_NAME")
	public String getRolevalRoleName()
	{
		return this.rolevalRoleName;
	}

	public void setRolevalRoleName(String rolevalRoleName)
	{
		this.rolevalRoleName = rolevalRoleName;
	}

	@Column(name = "ROLEVAL_ROLE_DESC", length = 1000)
	public String getRolevalRoleDesc()
	{
		return this.rolevalRoleDesc;
	}

	public void setRolevalRoleDesc(String rolevalRoleDesc)
	{
		this.rolevalRoleDesc = rolevalRoleDesc;
	}

	@Column(name = "ROLEVAL_DELETED", length = 1)
	public String getRolevalDeleted()
	{
		return this.rolevalDeleted;
	}

	public void setRolevalDeleted(String rolevalDeleted)
	{
		this.rolevalDeleted = rolevalDeleted;
	}

	@Column(name = "ROLEVAL_DATE_CREATED", nullable = false, length = 11)
	public Timestamp getRolevalDateCreated()
	{
		return this.rolevalDateCreated;
	}

	public void setRolevalDateCreated(Timestamp rolevalDateCreated)
	{
		this.rolevalDateCreated = rolevalDateCreated;
	}

	@Column(name = "ROLEVAL_DATE_MODIFIED", length = 11)
	public Timestamp getRolevalDateModified()
	{
		return this.rolevalDateModified;
	}

	public void setRolevalDateModified(Timestamp rolevalDateModified)
	{
		this.rolevalDateModified = rolevalDateModified;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "twRoleval")
	public Set<TwRolepriv> getTwRoleprivs()
	{
		return this.twRoleprivs;
	}

	public void setTwRoleprivs(Set<TwRolepriv> twRoleprivs)
	{
		this.twRoleprivs = twRoleprivs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "twRoleval")
	public Set<TwUserval> getTwUservals()
	{
		return this.twUservals;
	}

	public void setTwUservals(Set<TwUserval> twUservals)
	{
		this.twUservals = twUservals;
	}

}